package com.hyc.myvideo.ui.view;

import android.view.Gravity;
import android.view.View;

import com.hyc.myvideo.R;
import com.hyc.myvideo.ui.base.BaseDialogFragment;

import butterknife.OnClick;

/**
 * 弹框提示-直播弹出是否VIP
 * @author  gyb
 * @version 1.0
 * @created 2017/8/11
 */

public class DialogLiveVIP extends BaseDialogFragment {
    private VIPInterface anInterface = null;

    public DialogLiveVIP(VIPInterface anInterface){
        this.anInterface = anInterface;
    }

    public void onLook() {
        if(anInterface != null){
            anInterface.onLook();
        }
    }

    public void onVIP() {
        if(anInterface != null){
            anInterface.onVIP();
        }
    }

    @Override
    public int getContentViewId() {
        return R.layout.dialog_live_pay;
    }

    @Override
    public int getGravity() {
        return Gravity.CENTER;
    }

    @Override
    protected void initView() {

    }


    @OnClick({R.id.dialog_vip_look, R.id.dialog_vip_confirm})
    public void onClick(View v) {
       switch (v.getId()){
           //试看
           case R.id.dialog_vip_look:
               onLook();
               hideDialog();
               break;
           //确认开通
           case R.id.dialog_vip_confirm:
               onVIP();
               hideDialog();
               break;
       }
    }

    public interface VIPInterface{
        void onLook();
        void onVIP();
    }

}
